import { Button } from "antd";
import { BasicPropsType } from "../props";

interface ComponentProps {
	ok?: Fn;
	cancel: Fn;
}

const ModalFooter = (props: BasicPropsType & ComponentProps) => {
	return (
		<div>
			{props.showCancelBtn && (
				<Button {...props.cancelButtonProps} onClick={props.cancel}>
					{props.cancelText}
				</Button>
			)}

			{props.showOkBtn && (
				<Button type={props.okType} loading={props.confirmLoading} {...props.okButtonProps} onClick={props.ok}>
					{props.okText}
				</Button>
			)}
		</div>
	);
};

export default ModalFooter;
